import fs = require('fs');

class ShaderFile {
    name: string;
    type: shaderType
    constructor(public path: string) {
        this.path = path
        this.readShaderFile(this)
    }

    readShaderFile<shaderT extends ShaderFile>(shader: shaderT) {
        console.log(shader)
        let obj = fs.readFileSync(shader.path,'utf8')
        console.log(obj)
        return obj
    }
}

class VertFile extends ShaderFile {
    name: string;
    type: shaderType.vert
    constructor(public path: string) {
        super(path)
    }
}

class FragFile extends ShaderFile {
    name: string;
    type: shaderType.frag
    constructor(public path: string) {
        super(path)
    }
}


const enum shaderType {
    vert = 'vert',
    frag = 'frag'
}

let v = new VertFile('./a')
let f = new FragFile('./b')

